package it.tukano.treditor.resources;

import it.tukano.image.SvgIconPack;
import java.awt.Dimension;
import javax.swing.Icon;

/**
 * Icons store
 * @author pgi
 */
public class Icons {
    private static final Icons ISTANCE = new Icons();
    
    public static Icon get(String name, int size) {
        return Icons.get(name, new Dimension(size, size));
    }
    
    public static Icon get(String name, Dimension size) {
        return ISTANCE.getIcon(name, size);
    }
    
    public static final String NODE_ICON = "node_icon";
    
    private final SvgIconPack pack;

    /**
     * Instance initializer
     */
    public Icons() {
        pack = new SvgIconPack(Icons.class.getResource("/it/tukano/treditor/resources/iconpack.svg"));
    }
    
    public Icon getIcon(String name, int size) {
        return pack.get(name, new Dimension(size, size));
    }
    
    public Icon getIcon(String svgGroupName, Dimension size) {
        return pack.get(svgGroupName, size);
    }
}
